package com.tajiang.business.common.utils;

import android.app.Service;
import android.media.AudioManager;
import android.media.MediaPlayer;

import com.tajiang.business.R;
import com.tajiang.business.common.application.TJApp;

/**
 * Created by SQL on 2016/9/1.
 */
public class AudioPlayerUtils {

    private volatile static MediaPlayer mediaPlayer ;  //声频

    public static void playOrderNotifyAudio() {

        if (mediaPlayer == null) {
            mediaPlayer = MediaPlayer.create(TJApp.getInstance(),R.raw.audio_new_order);
        }
        if (!mediaPlayer.isPlaying()) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    mediaPlayer.start();
                }
            }).start();
        }

    }

}
